package com.baizhi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//对应MySQL中first库中的tbl_student表
public class Student {
    private Integer id;
    private String name;
    private Integer age;
    @DateTimeFormat(pattern = "yyyy-MM-dd") //接收日期的格式
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss") //响应json的日期格式
    private Date birth;
    private String pic;
    public Student() {
    }

    public Student(Integer id, String name, Integer age, Date birth,String pic) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.birth = birth;
        this.pic = pic;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", birth=" + birth +
                ", pic='" + pic + '\'' +
                '}';
    }
}
